<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>AutoHello by SEALiu</title>

    <link rel="stylesheet" href="stylesheets/styles.css">
    <link rel="stylesheet" href="stylesheets/github-light.css">
    <meta name="viewport" content="width=device-width">
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="wrapper">
      <header>
        <h1>AutoHello</h1>
        <p>代替你和人类保持虚假的亲密关系</p>

        <p class="view"><a href="https://github.com/SEALiu/AutoHello">View the Project on GitHub <small>SEALiu/AutoHello</small></a></p>


        <ul>
          <li><a href="https://github.com/SEALiu/AutoHello/zipball/master">Download <strong>ZIP File</strong></a></li>
          <li><a href="https://github.com/SEALiu/AutoHello/tarball/master">Download <strong>TAR Ball</strong></a></li>
          <li><a href="https://github.com/SEALiu/AutoHello">View On <strong>GitHub</strong></a></li>
        </ul>
      </header>
      <section>
        <p><img src="https://github.com/SEALiu/AutoHello/blob/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png?raw=true" alt="AutoHello"></p>

<h1>
<a id="autohello" class="anchor" href="#autohello" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>AutoHello</h1>

<h2>
<a id="app下载" class="anchor" href="#app%E4%B8%8B%E8%BD%BD" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>APP下载</h2>

<ul>
<li>
<a href="https://play.google.com/store/apps/details?id=cn.studyjams.s1.contest.autohello">Googl Play</a><br>
</li>
</ul>

<h2>
<a id="基本信息" class="anchor" href="#%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>基本信息</h2>

<p><strong>AutoHello</strong>可以代替你和人类保持虚假的亲密关系。甚至可以做到过分的地步！每天早上给TA发送天气预报，叫TA起床。过年过节给TA节日的问候，只要你愿意甚至是清明节也可以。TA的生日是哪天，一点都不重要，无论你是否记得，<strong>AutoHello</strong>都会替你发送短信/邮件。</p>

<p>我们的目标是：一次设置，终身受益！</p>

<p><a href="https://docs.google.com/document/d/181nMTPEbtpZBdg-weZsDi2nGDBJ8C3fNb2DmaCEC1fE/edit?usp=sharing">欢迎评论：Overview on Google Doc(更新中)</a></p>

<h2>
<a id="运行要求" class="anchor" href="#%E8%BF%90%E8%A1%8C%E8%A6%81%E6%B1%82" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>运行要求</h2>

<ul>
<li>minSdkVersion：19</li>
<li>Google Play Service</li>
<li>梯子 工工工工 <a href="https://portal.shadowsocks.com/aff.php?aff=3661">AD: shadowsocks</a>
</li>
</ul>

<h2>
<a id="如何开始" class="anchor" href="#%E5%A6%82%E4%BD%95%E5%BC%80%E5%A7%8B" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>如何开始</h2>

<p><strong>AutoHello</strong>使用Google Firebase，在开始前请将确保该APP导入到你的Firebase项目中.另外需要注意：</p>

<ul>
<li>替换<code>google-services.json</code>
</li>
<li>
<strong>Google Map API</strong><br>

<ul>
<li>在 Google APIs 中获取 Google Maps Android API 的 Key<br>
</li>
</ul>
</li>
<li>
<strong>OpenWeatherMap</strong><br>

<ul>
<li>在<a href="http://openweathermap.org/api">OpenWeatherMap</a>注册账户，获取自己的APPID</li>
</ul>
</li>
<li>替换<code>AndroidManifest.xml</code>中的<code>google_map_api_key</code>：</li>
</ul>

<div class="highlight highlight-text-xml"><pre>...
&lt;<span class="pl-ent">application</span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">"</span>.MyFirebaseApp<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">allowBackup</span>=<span class="pl-s"><span class="pl-pds">"</span>true<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">icon</span>=<span class="pl-s"><span class="pl-pds">"</span>@mipmap/ic_launcher<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">label</span>=<span class="pl-s"><span class="pl-pds">"</span>@string/app_name<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">supportsRtl</span>=<span class="pl-s"><span class="pl-pds">"</span>true<span class="pl-pds">"</span></span>
        <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">theme</span>=<span class="pl-s"><span class="pl-pds">"</span>@style/AppTheme<span class="pl-pds">"</span></span>&gt;
        &lt;<span class="pl-ent">meta-data</span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">"</span>com.google.android.geo.API_KEY<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">value</span>=<span class="pl-s"><span class="pl-pds">"</span>google_map_api_key<span class="pl-pds">"</span></span> /&gt;
...</pre></div>

<ul>
<li>替换<code>WeatherHttpClient.java</code>中的<code>OpenWeatherMap_APPID</code>
</li>
</ul>

<div class="highlight highlight-source-java"><pre><span class="pl-c1">...</span>
<span class="pl-smi">String</span> <span class="pl-c1">BASE_URL</span> <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>http://api.openweathermap.org/data/2.5/weather?<span class="pl-pds">"</span></span>;
            con <span class="pl-k">=</span> (<span class="pl-smi">HttpURLConnection</span>) (
                    <span class="pl-k">new</span> <span class="pl-smi">URL</span>(<span class="pl-c1">BASE_URL</span> <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">"</span>lat=<span class="pl-pds">"</span></span> <span class="pl-k">+</span>
                            lat <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">"</span>&amp;lon=<span class="pl-pds">"</span></span> <span class="pl-k">+</span> lon <span class="pl-k">+</span>
                            <span class="pl-s"><span class="pl-pds">"</span>&amp;appid=OpenWeatherMap_APPID<span class="pl-pds">"</span></span>
                    )
            )<span class="pl-k">.</span>openConnection();
            con<span class="pl-k">.</span>setRequestMethod(<span class="pl-s"><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span>);
            con<span class="pl-k">.</span>setDoInput(<span class="pl-c1">true</span>);
            con<span class="pl-k">.</span>setDoOutput(<span class="pl-c1">true</span>);
            con<span class="pl-k">.</span>connect();
<span class="pl-c1">...</span></pre></div>

<ul>
<li>如遇到其他问题请联系我</li>
</ul>
      </section>
      <footer>
        <p>This project is maintained by <a href="https://github.com/SEALiu">SEALiu</a></p>
        <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
      </footer>
    </div>
    <script src="javascripts/scale.fix.js"></script>
    
  </body>
</html>
